package com.iran.state.test;

import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;

public class DiaoYeReading extends AbstractState {

    @Override
    public void handle(DiaoYeWork work) {
        //当时间在16点以后，阅读
        if (work.getTime().toInstant().atZone(ZoneId.systemDefault()).toLocalTime().isBefore(LocalTime.of(19,0))){
            work.setWorking("正在阅读...");
        }else {
            work.setState(new DiaoYeGoHome());
            work.request();
        }

    }
}
